package com.etonedu.meals.machine;

import com.blankj.utilcode.util.LogUtils;
import com.etonedu.meals.bean.MachineTimeBean;
import com.etonedu.meals.common.SPConst;
import com.etonedu.meals.utils.SharedPreferencesUtil;

import org.xutils.x;

/**
 * Created by Administrator on 2017/6/26.
 */

public class OperationMachine {

    public static void setOnOffMachine(MachineTimeBean om) {
        LogUtils.d("设置开关机时间");
        SharedPreferencesUtil spu = SharedPreferencesUtil.getInstance(x.app());
        spu.setLong(SPConst.START_MACHINE_TIME,om.getOnTime());
        spu.setLong(SPConst.END_MACHINE_TIME,om.getOffTime());
        DeviceUtils.closeMachine(om.getOffDate(),om.getOnDate());
        DeviceUtils.setOnOffMachineV2(om);
        DeviceUtils.setMachineDev(om);
    }
}
